package com.huahang.fashionpress.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huahang.fashionpress.model.NickRole;
import com.huahang.fashionpress.model.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface NickroleMapper extends BaseMapper<NickRole> {
    @Select("select t_role.role_id,role_name,role_url from t_nick_role,t_role where nick_id=#{id} and t_role.role_id=t_nick_role.role_id")
    List<Role> selectAllroleIdBynickId(int id);
    @Delete("delete from t_nick_role where nick_id=#{id}")
    void deleteBynickId(int id);
    @Select("select nick_role_id from t_nick_role where nick_id=#{nickId} and role_id=#{roleId}")
    int selectnickroleId(int nickId,int roleId);
}
